home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15735 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  39 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.inap.net!news1!news
  3. From: potterb@iquest.net (Brad Potter)
  4. Subject: Problems Porting clcc code from sun/os to solaris
  5. X-Nntp-Posting-Host: ind-015-238-82.iquest.net
  6. Message-ID: <Dq3A9u.17H@iquest.net>
  7. Sender: news@iquest.net (News Admin)
  8. Organization: IQuest Network Services
  9. X-Newsreader: WinVN 0.91.6
  10. Date: Fri, 19 Apr 1996 03:13:05 GMT
  11.  
  12. I really need some help with this.  I am in the process of  converting C 
  13. code from SUN/OS to Solaris.  I am using Centerline C version 4.1.1.  The 
  14. program works fine in SUN/OS, but when I compile it and run it on a 
  15. solaris machine, it appears to run into some sort of buffering problem.
  16. This is what I know so far.
  17.  
  18. The program opens a text file using fopen(filename, "r+u") option so that 
  19. the text will be unbuffered (a known bug) and in update mode.  By the 
  20. time the program has determined if we will process the line the pointer 
  21. is sitting on the EOF marker.  We want to mark the line as Processed by 
  22. placing a 'P' in the last position of the line before the EOL marker.  I 
  23. am using fseek(filename, -2, SEEKCUR) to back the pointer up 2 places.  I 
  24. then use a fputc('P', filename) to add a 'P' as the last character in the 
  25. file.
  26.  
  27. What happens is that not only does the 'P' get added to the last position 
  28. but also 30 - 40 other characters get attached as well.  I have contacted 
  29. Centerline about this problem and they suggested that the problems lies 
  30. in the /lib/libc.a library.  The latest update to this library that I
  31. have used is dated April 11, 1995.
  32.  
  33. I am really stuck on this.  I hope there is someone out there that has 
  34. run into this problem and can help me with a fix.  We have several vender 
  35. c programs that use fopen(filename, "r+u") that I have not yet tested but 
  36. will be doing so in the near future.
  37.  
  38. Any suggestions and/or help is greatly appreciated. 
  39.